// src/main/java/com/bookmanager/model/UserProfile.java
package com.bookmanager.model;

import java.time.LocalDateTime;

public class UserProfile {
    private String userId;
    private String username;
    private String email;
    private String phone;
    private String role;
    private LocalDateTime createTime;
    private int borrowCount;      // 借阅数量
    private int favoriteCount;    // 收藏数量
    private int currentBorrows;   // 当前借阅

    // 构造方法
    public UserProfile() {}

    public UserProfile(User user) {
        this.userId = user.getUserId();
        this.username = user.getUsername();
        this.email = user.getEmail();
        this.phone = user.getPhone();
        this.role = user.getRole();
        this.createTime = user.getCreateTime();
    }

    // Getter 和 Setter 方法
    public String getUserId() { return userId; }
    public void setUserId(String userId) { this.userId = userId; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }

    public String getRole() { return role; }
    public void setRole(String role) { this.role = role; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public int getBorrowCount() { return borrowCount; }
    public void setBorrowCount(int borrowCount) { this.borrowCount = borrowCount; }

    public int getFavoriteCount() { return favoriteCount; }
    public void setFavoriteCount(int favoriteCount) { this.favoriteCount = favoriteCount; }

    public int getCurrentBorrows() { return currentBorrows; }
    public void setCurrentBorrows(int currentBorrows) { this.currentBorrows = currentBorrows; }
}
